package {
	import flash.display.Sprite;
	
	import frank.zou.study.HelloDynamicClass;
	



	public class HelloAS3Flex3 extends Sprite
	{
		private function hello2(who:String):void { 
			trace("Hello2: " + who);
		}		
		
		private function hello3(who:String):void { 
			trace("Hello3: " + who);
		}	
			
		public function HelloAS3Flex3()
		{
			trace("hello as3. ");
			var dynamicClass:HelloDynamicClass = new HelloDynamicClass();
			
			// dynamic attributres
			dynamicClass.x=10;
			trace("dynamicClass.x: " + dynamicClass.x);

			// dynamic methods 
			dynamicClass.myFunc = function(who:String):void { 
				trace("Hello: " + who + "\n");	
			};
			dynamicClass.myFunc("frank.");
			
			dynamicClass.hello2 = this.hello2;
			dynamicClass.hello2("God");
			
			dynamicClass.hello3 = this["hello3"];
			dynamicClass.hello3("You.");
			
		}
	}
}
